import 'package:json_annotation/json_annotation.dart';

import 'axis.dart';
import 'axis_pointer.dart';
import 'text_style.dart';

part 'radar.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Indicator {
  var name;
  var max;
  var min;
  var color;

  Indicator({this.name, this.max, this.min, this.color});

  factory Indicator.fromJson(Map<String, dynamic> json) => _$IndicatorFromJson(json);

  Map<String, dynamic> toJson() => _$IndicatorToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Radar {
  var id;
  var zlvel;
  var z;
  var center;
  var radius; //number var Array
  var startAngle;
  TextStyle? name;
  var nameGap;
  var splitNumber;
  var shape;
  var scale;

  var silent;
  var triggerEvent;
  AxisLine? axisLine;
  AxisTick? axisTick;
  MinorTick? minorTick;
  AxisLabel? axisLabel;
  SplitLine? splitLine;
  MinorSplitLine? minorSplitLine;
  SplitArea? splitArea;
  List<AxisData>? data;
  AxisPointer? axisPointer;
  List<Indicator>? indicator;

  Radar(
      {this.id,
      this.zlvel,
      this.z,
      this.center,
      this.radius,
      this.startAngle,
      this.name,
      this.nameGap,
      this.splitNumber,
      this.shape,
      this.scale,
      this.silent,
      this.triggerEvent,
      this.axisLine,
      this.axisTick,
      this.minorTick,
      this.axisLabel,
      this.splitLine,
      this.minorSplitLine,
      this.splitArea,
      this.data,
      this.axisPointer,
      this.indicator});

  factory Radar.fromJson(Map<String, dynamic> json) => _$RadarFromJson(json);

  Map<String, dynamic> toJson() => _$RadarToJson(this);
}
